import java.util.Scanner;

public class Text {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int count=0;
        while(n!=0){
            count+=n&1;
            n>>>=1;
        }
        System.out.println(count);
    }
    public static void main6(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int b=sc.nextInt();
        if(a<b){
            int tmp=a;
            a=b;
            b=tmp;
        }
        int c=0;
        while(b>0){
            c=a%b;
            a=b;
            b=c;
        }
        System.out.println(a);
    }
    public static void main5(String[] args) {
        double num=1.0;
        double sum=0;
        for (int i = 1; i <= 100; i++) {
            sum+=num/i;
            num*=-1;
        }
        System.out.println(sum);
    }
    public static void main4(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n= sc.nextInt();
        for (int i = 100; i < n; i++) {
            int s=i;
            int sum=0;
            while(s>0){
                sum+=Math.pow(s%10,3);
                s/=10;
            }
            if(sum==i){
                System.out.println(i);
            }
        }
    }
        public static void main3(String[] args) {
            Scanner sc=new Scanner(System.in);
            int n=sc.nextInt();
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    if(i==j||(i+j)==n-1){
                        System.out.print('*');
                    }
                    else{
                        System.out.print(" ");
                    }
                }
                System.out.println();
            }
        }
    public static void main2(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        if((n%4==0&&n%100!=0)||n%400==0){
            System.out.println("是闰年");
        }
        else{
            System.out.println("不是闰年");
        }
    }
    public static void main1(String[] args) {
        int count=0;
        for (int i = 9; i <= 100; i++) {
            int n=i;
            while(n>0){
                if(n%10==9){
                    count++;
                }
                n/=10;
            }
        }
        System.out.println(count);
    }
}
